package com.tim.temp;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 安装订单请求对象
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class InstallOrderRequest {

    @NotBlank(message = "AppCode 不能为空")
    @Size(max = 50, message = "AppCode 最长为 50 个字符")
    @ApiModelProperty(value = "申请编号", required = true, notes = "若没有则会根据规则自动生成编号")
    private String AppCode;

    @NotBlank
    @ApiModelProperty(value = "产品ID", required = true, notes = "业务确认产品组合后，产品id由中瑞提供")
    private String ProductId;

    @Size(max = 2)
    @ApiModelProperty(value = "产品类型", notes = "若productId为空则需要根据产品名称及其他协议好的逻辑来获取对应产品")
    private String ProductType;

    @NotBlank(message = "DistrictCode 不能为空")
    @Size(max = 10, message = "DistrictCode 最长为 10 个字符")
    @ApiModelProperty(value = "地区编码", required = true, notes = "加装城市,请根据最新国标区划编码，中瑞可提供")
    private String DistrictCode;

    @NotBlank(message = "InstallAdd 不能为空")
    @Size(max = 200, message = "InstallAdd 最长为 200 个字符")
    @ApiModelProperty(value = "安装地址", required = true, notes = "实际加装的详细地址")
    private String InstallAdd;

    @NotNull(message = "InstallTime 不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "安装时间", required = true, notes = "要求上门加装时间，格式：yyyy-MM-dd HH:mm")
    private LocalDateTime InstallTime;

    @NotBlank(message = "ShopName 不能为空")
    @Size(max = 100, message = "ShopName 最长为 100 个字符")
    @ApiModelProperty(value = "安装店面", required = true)
    private String ShopName;

    @NotBlank(message = "LinkMan 不能为空")
    @Size(max = 50, message = "LinkMan 最长为 50 个字符")
    @ApiModelProperty(value = "店面联系人", required = true)
    private String LinkMan;

    @NotBlank(message = "LinkPhone 不能为空")
    @Size(max = 20, message = "LinkPhone 最长为 20 个字符")
    @ApiModelProperty(value = "店面联系电话", required = true)
    private String LinkPhone;

    @NotBlank(message = "UserName 不能为空")
    @Size(max = 50, message = "UserName 最长为 50 个字符")
    @ApiModelProperty(value = "车主名称", required = true)
    private String UserName;

    @NotBlank(message = "UserPhone 不能为空")
    @Size(max = 20, message = "UserPhone 最长为 20 个字符")
    @ApiModelProperty(value = "车主电话", required = true)
    private String UserPhone;

    @Size(max = 10)
    @ApiModelProperty(value = "车主城市地区编码")
    private String UserCity;

    @Size(max = 200)
    @ApiModelProperty(value = "车主地址")
    private String UserAddress;

    @Size(max = 1)
    @ApiModelProperty(value = "证件类型", allowableValues = "0,1,2", notes = "0:身份证, 1:组织机构代码, 2:其他 （有保险的产品必填）")
    private String IDType;

    @Size(max = 50)
    @ApiModelProperty(value = "证件号码", notes = "车主证件号码（有保险的产品必填）")
    private String IDCode;

    @Size(max = 100)
    @ApiModelProperty(value = "车型")
    private String CarType;

    @NotBlank(message = "VIN 不能为空")
    @Size(max = 50, message = "VIN 最长为 50 个字符")
    @ApiModelProperty(value = "车架号", required = true, notes = "根据车架号确定安装车辆")
    private String VIN;

    @ApiModelProperty(value = "服务供应商", allowableValues = "0,1", notes = "0：中瑞安装，1：客户自装；不传默认中瑞安装")
    private Integer InstallType;

    @Size(max = 50)
    @ApiModelProperty(value = "车牌号")
    private String PlateNumber;

    @Size(max = 50)
    @ApiModelProperty(value = "车辆颜色")
    private String Color;

    @ApiModelProperty(value = "车辆价格")
    private BigDecimal CarPrice;

    @ApiModelProperty(value = "开票价格", notes = "车辆的开票价格（有保险产品必填）")
    private BigDecimal InvoicePrice;

    @ApiModelProperty(value = "贷款金额", notes = "贷款金额（责信险产品必填）")
    private BigDecimal LoanAmount;

    @ApiModelProperty(value = "付款方式", allowableValues = "true,false", notes = "true:全款, false:分期 （有保险的产品必填）")
    private Boolean PayType;

    @Size(max = 1)
    @ApiModelProperty(value = "贷款年限", notes = "单位：月（有保险的产品必填）")
    private String CreditPeriod;

    @Min(1)
    @Max(3)
    @ApiModelProperty(value = "保险年限", allowableValues = "1,2,3", notes = "单位：年（1、2、3）")
    private Integer InsurancePeriod;

    @Size(max = 1)
    @ApiModelProperty(value = "车辆类型", allowableValues = "1,2,3", notes = "1:新车, 2:二手车, 3:进口车 （有保险的产品必填）")
    private String CarStyle;

    @ApiModelProperty(value = "加装设备数量")
    private Integer Num;

    @Size(max = 100)
    @ApiModelProperty(value = "受偿单位", notes = "有保险产品必填")
    private String CompensationDQ;

    @ApiModelProperty(value = "延期数", allowableValues = "0,1", notes = "0：不延期，1：延一年")
    private Integer DelayNum;

    @Size(max = 50)
    @ApiModelProperty(value = "发动机号")
    private String EngineNumber;

    @Size(max = 2)
    @ApiModelProperty(value = "设备来源")
    private String Source;

    @Size(max = 20)
    @ApiModelProperty(value = "特殊标记")
    private String SpecialTag;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "下单时间")
    private LocalDateTime CreatedAt;

    @Size(max = 500)
    @ApiModelProperty(value = "备注")
    private String Remark;

    @Size(max = 36)
    @ApiModelProperty(value = "合作单位")
    private String UnitName;

    @Size(max = 50)
    @ApiModelProperty(value = "合同编号")
    private String ContactCode;

    @ApiModelProperty(value = "盗抢保障服务系统收费")
    private BigDecimal InsurFeePrice;

    @Size(max = 50)
    @ApiModelProperty(value = "第二联系人姓名")
    private String SecondLinkMan;

    @Size(max = 20)
    @ApiModelProperty(value = "第二联系人联系电话")
    private String SecondLinkTel;

    @Size(max = 100)
    @ApiModelProperty(value = "追加设备标记", notes = "同一个车辆需要增加设备时此字段必填")
    private String ExtraTag;

    @ApiModelProperty(value = "是否自动生成钥匙工单", allowableValues = "true,false", notes = "当增加GPS工单时，如果需要同时生成钥匙工单；true：生成 false：不生成（已配置的客户不传默认生成）")
    private Boolean ifAutoNonSelforder;
}
